import Layout from '@/views/layout/Layout'

const distributionRouter = {
  path: '/distribution',
  name: 'Distribution',
  component: Layout,
  redirect: '/distribution/about',
  meta: {title: '分销', icon: 'link'},
  children: [
    {
      path: 'about',
      name: 'Distirbution-about',
      component: () => import('@/views/distribution/about'),
      meta: {
        title: '分销概览'
      }
    },
    {
      path: 'agency',
      name: 'Distirbution-agency',
      component: () => import('@/views/distribution/agency'),
      redirect: 'agency/manage',
      meta: {
        title: '代理管理'
      },
      children: [
        {
          path: 'manage',
          name: 'Agency-manage',
          component: () => import('@/views/distribution/agencymanage'),
          meta: {title: '代理商管理'}
        },
        {
          path: 'achievement',
          name: 'Agency-achievement',
          component: () => import('@/views/distribution/agencyachievement'),
          meta: {title: '代理商业绩'}
        }
      ]
    },
    {
      path: 'data',
      name: 'Distribute-data',
      component: () => import('@/views/distribution/data'),
      redirect: 'data/user',
      meta: {
        title: '分销数据'
      },
      children: [
        {
          path: 'user',
          name: 'Data-registerUser',
          component: () => import('@/views/distribution/datauser'),
          meta: {
            title: '用户拉新'
          }
        },
        {
          path: 'course',
          name: 'Data-courseDistribution',
          component: () => import('@/views/distribution/datacourse'),
          meta: {
            title: '课程分销'
          }
        },
        {
          path: 'class',
          name: 'Data-classDistribution',
          component: () => import('@/views/distribution/salesclass'),
          meta: {
            title: '班级分销'
          }
        }
      ]
    },
    {
      path: 'finance',
      name: 'Finance',
      component: () => import('@/views/distribution/financeClose'),
      redirect: 'financeClose/settlement',
      meta: {
        title: '财务结算'
      },
      children: [
        {
          path: 'settlement',
          name: 'Settlement',
          component: () => import('@/views/distribution/settlement'),
          meta: {
            title: '财务结算'
          }
        }
      ]
    },
    {
      path: 'sales',
      name: 'Sales',
      component: () => import('@/views/distribution/sales'),
      redirect: 'sales/salesuser',
      meta: {
        title: '分销设置'
      },
      children: [
        {
          path: 'salesuser',
          name: 'SalesUser',
          component: () => import('@/views/distribution/salesuser'),
          meta: {
            title: '用户拉新'
          }
        },
        {
          path: 'salescourse',
          name: 'SalesCourse',
          component: () => import('@/views/distribution/salescourse'),
          meta: {
            title: '课程分销'
          }
        },
        {
          path: 'salesclass',
          name: 'SalesClass',
          component: () => import('@/views/distribution/salesclass'),
          meta: {
            title: '班级分销'
          }
        },
        {
          path: 'salesuserlevel',
          name: 'SalesUserLevel',
          component: () => import('@/views/distribution/salesuserlevel'),
          meta: {
            title: '用户等级分销'
          }
        }
      ]
    },
    {
      path: 'system_setting',
      name: 'System_Setting',
      component: () => import('@/views/distribution/systemSetting'),
      meta: {
        title: '设置'
      }
    }
  ]
}

export default distributionRouter
